package cn.tedu.spring.config;

import cn.tedu.spring.file.DataBase;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class TextConfig {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext
                (AppConfig.class);
        //获取DataBase对象
        DataBase db = ctx.getBean(DataBase.class);
        System.out.println("db="+db);
        ctx.close();
    }
}
